import { Injectable } from '@angular/core';
import { Response } from '@angular/http'

import { NetService } from '../utils/net.service'
import { authService } from '../config/server'
import { User } from '../models/user.model'

@Injectable()
export class AuthService {

  constructor(private net: NetService) {

  }

  /**
   * 用户登录
   */
  login(user: User) {
    return this.net.send({
      service: authService.login,
      params: {
        password: user.password,
        username: user.username
      }
    })
  }

  /**
   * 域管理员登录
   */
  register() {

  }
}
